package com.settlement.system.csv;


import com.settlement.system.common.enums.ExcelFileType;

import java.util.List;
import java.io.IOException;
import java.util.Map;

/**
 * @author author
 */
public abstract class AbstractCsvWrite implements CsvWrite {

    protected String fileName;
    protected Class headClass;
    protected Headers headers;
    protected ExcelFileType fileType;
    protected boolean customized;
    protected boolean ifMapData;
    protected List<List<String>> xlsxHeaderList;
    protected Map<Integer, Integer> columnWidthMap;


    public AbstractCsvWrite(ExcelFileType fileType,
                            Class headClass,
                            Headers headers,
                            String fileName,
                            boolean customized,
                            boolean ifMapData,
                            List<List<String>> xlsxHeaderList,
                            Map<Integer, Integer> columnWidthMap
    ) throws IOException {
        this.fileType = fileType;
        this.headClass = headClass;
        this.headers = headers;
        this.fileName = fileName;
        this.customized = customized;
        this.ifMapData = ifMapData;
        this.xlsxHeaderList = xlsxHeaderList;
        this.columnWidthMap = columnWidthMap;
        initFile();
    }

    /**
     * initFile
     * @throws IOException
     */
    public abstract void initFile() throws IOException;

}
